﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="SanPham.aspx.cs" Inherits="IMark.SanPham" %>
<%@ Register src="UC/SanPhamDacBietCtrl.ascx" tagname="SanPhamDacBietCtrl" tagprefix="uc1" %>
<%@ Register src="UC/DangKyNhanTinCtrl.ascx" tagname="DangKyNhanTinCtrl" tagprefix="uc1" %>
<%@ Register src="UC/MenuLoaiSPLienQuanCtrl.ascx" tagname="MenuLoaiSPLienQuanCtrl" tagprefix="uc2" %>
<%@ Register src="UC/MenuSPXemGanDay.ascx" tagname="MenuSPXemGanDay" tagprefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script src="js/kendo.all.min.js"></script>
    <link href="css/kendo.common.min.css" rel="stylesheet" />
    <link href="css/kendo.metro.min.css" rel="stylesheet" />
    <style type="text/css">
        .k-widget, .k-block, .k-inline-block, .k-draghandle{
            border-style: none; 
            border-width: 0px;
            -webkit-appearance: none;
        }
        .k-animation-container, .k-widget, .k-widget *, .k-animation-container *, .k-widget *:before, .k-animation-container *:after, .k-block .k-header, .k-list-container{
            -webkit-box-sizing: inherit;
            -moz-box-sizing: inherit;
            box-sizing: inherit; 
        }
        #pagesize span span,#pagesize span a{
            background-color: #00aff0;
            border: 1px solid #ffffff;
            color: #ffffff;
            padding: 10px 18px;
            font-size: 18px;
            position: relative;
            float: left;
            padding: 6px 12px;
            margin-left: -1px;
            line-height: 1.428571429;
            text-decoration: none;
            color: #ffffff;
            background-color: #00aff0;
            border: 1px solid #ffffff;
        }
    #pagesize{
        padding-left:15px;
    }
    .small-btns div{
        cursor:pointer
    }
    </style>
    <script src="js/DatHang.js"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="container">
        <div class="row">
            <div class="col-md-12">
                <div class="breadcrumb"><a href="Default.aspx"><i class="fa fa-home fa-fw"></i>Home </a><i class="fa fa-angle-right fa-fw"></i><a href="Products.aspx">DS Sản Phẩm </a></div>

                <!-- Quick Help for tablets and large screens -->
                <div class="quick-message hidden-xs">
                    <div class="quick-box">
                        <div class="quick-slide">
                            <span class="title">Help</span>
                            <div class="quickbox slide" id="quickbox">
                                <div class="carousel-inner">
                                    <div class="item active"><a href="#"><i class="fa fa-envelope fa-fw"></i>Gửi Mail</a> </div>
                                    <div class="item"><a href="#"><i class="fa fa-question-circle fa-fw"></i>Chat Online</a> </div>
                                    <div class="item"><a href="#"><i class="fa fa-phone fa-fw"></i>(08) 666 888</a> </div>
                                </div>
                            </div>
                            <a class="left carousel-control" data-slide="prev" href="#quickbox"><i class="fa fa-angle-left fa-fw"></i></a><a class="right carousel-control" data-slide="next" href="#quickbox"><i class="fa fa-angle-right fa-fw"></i></a>
                        </div>
                    </div>
                </div>
                <!-- end: Quick Help -->

            </div>
        </div>
    </div>
    
    <div class="row clearfix f-space10"></div>
    <div class="container">
        <!-- row -->
        <div class="row">
            <div class="col-md-9 col-sm-12 col-xs-12 box-block">
                <div class="box-content">
                    <div class="box-products">

                        <!-- Products Row -->
                        <div class="row box-product">
                            <asp:ListView ItemPlaceholderID="ItemId" ID="ListView1" runat="server" OnItemDataBound="ListView1_ItemDataBound">
                                <LayoutTemplate>
                                    <div class="nn-box-col-wrapper">
                                        <span id="ItemId" runat="server" />
                                    </div>
                                    <div id="pagesize" style="text-align: center;clear:both">
                                        <asp:DataPager PageSize="12" ID="DataPager1" runat="server">
                                            <Fields>
                                                <asp:NextPreviousPagerField FirstPageText="First"
                                                    ShowFirstPageButton="true" ShowLastPageButton="false"
                                                    ShowNextPageButton="false" ShowPreviousPageButton="false" />

                                                <asp:NumericPagerField NextPageText="Next" PreviousPageText="Prev" />

                                                <asp:NextPreviousPagerField LastPageText="Last"
                                                    ShowFirstPageButton="false" ShowLastPageButton="true"
                                                    ShowNextPageButton="false" ShowPreviousPageButton="false" />
                                            </Fields>
                                        </asp:DataPager>
                                    </div>
                                </LayoutTemplate>

                                <ItemTemplate>
                                   <!-- Product -->
                                    <div class="col-lg-4 col-md-4 col-sm-4 col-xs-12">
                                      <div class="product-block">
                                        <div class="image">
                                          <div class="product-label product-sale"><span><asp:Label ID="lblStatus" runat="server"></asp:Label></span></div>
                                          <a class="img" href="ChiTietSP.aspx?ID=<%#Eval("ID") %>"><asp:Image CssClass="ani-image" ID="SpecIcon" 
            ImageUrl="images/new_icon.gif" runat="server"/></a> </div>
                                        <div class="product-meta">
                                          <div class="name"><a href="ChiTietSP.aspx?ID=<%#Eval("ID") %>"><%#Eval("TenSanPham") %></a></div>
                                          <div class="big-price"> <asp:Label class="price-new" id="newPrice" runat="server"></asp:Label> 
                                          </div>
                                          <div class="big-btns"> 
                                              <a class="btn btn-default btn-view pull-left" href="ChiTietSP.aspx?ID=<%#Eval("ID") %>">Xem</a> 
                                              <a class="btn btn-default btn-addtocart pull-right" href="javascript:ThemVaoGioHang(<%#Eval("ID") %>,1)">Chọn Mua</a> </div>
                                          <div class="small-price"> 
                                              <asp:Label class="price-new" id="lblSmallNewPrice" runat="server"></asp:Label>
                                          </div>
                                          <div class="rating"> <asp:Label ID="rating" runat="server"></asp:Label> </div>
                                            
                                          <div class="small-btns">
                                            <div class="btn btn-default btn-compare pull-left" data-toggle="tooltip" title="Cho Vào So Sánh" onclick='Compare(<%#Eval("ID") %>)'> 
                                                <i class="fa fa-retweet fa-fw"></i> 
                                            </div>
                                            <div class="btn btn-default btn-wishlist pull-left" data-toggle="tooltip" title="Thêm Vào Yêu Thích" onclick="ThemVaoYeuThich(<%#Eval("ID") %>)"> <i class="fa fa-heart fa-fw"></i> </div>
                                            <div class="btn btn-default btn-addtocart pull-left" data-toggle="tooltip" title="Chọn Mua" onclick='ThemVaoGioHang(<%#Eval("ID") %>,1)'> <i class="fa fa-shopping-cart fa-fw"></i> </div>
                                          </div>
                                        </div>
                                        <div class="meta-back"></div>
                                      </div>
                                        <div class="row clearfix f-space20"></div>
                                    </div>
                                    <!-- end: Product --> 
                                    <%--<div class="row clearfix f-space20"></div>--%>
                                    <!--/mặt hàng 1-->
                                </ItemTemplate>

                            </asp:ListView>
                        </div>
                        
                        <!-- end: Products Row -->

                        <div class="clearfix f-space30"></div>
                    </div>
                </div>
            </div>

            <!-- side bar -->
            <div class="col-md-3 col-sm-12 col-xs-12 box-block page-sidebar">
                <div class="box-heading"><span>Tìm kiếm theo</span></div>
                <!-- Filter by -->
                <div class="box-content">
                    <div class="shopby">
                        <!-- Price Range -->
                        <span>Giao động từ</span>
                        <div class="pricerange">
                            <input type="text" id="price-range" name="price-range" />
                            <button id="btnXoa" class="btn color1 normal pull-right" type="submit">Clear</button>
                            
                            <input type="button" id="btnTimKiem"class="btn color1 normal" value="Tìm Kiếm"/>
                        </div>
                        <!--end: Price Range -->
                    </div>
                </div>
                <!-- end: Filter by -->

                <!--MENU Danh mục loại sản phẩm có liên quan-->
                <uc2:MenuLoaiSPLienQuanCtrl ID="MenuLoaiSPLienQuanCtrl1" runat="server" />
                <!--END MENU Danh mục loại sản phẩm có liên quan-->

                <div class="clearfix f-space30"></div>
                <uc1:SanPhamDacBietCtrl ID="SanPhamDacBietCtrl1" runat="server" /> 
                
                <!-- Get Updates Box -->
                <uc1:MenuSPXemGanDay ID="MenuSPXemGanDay1" runat="server" />

                <div class="clearfix f-space30"></div>
                <!-- Get Updates Box -->
                <uc1:DangKyNhanTinCtrl ID="DangKyNhanTinCtrl1" runat="server" />
                <!-- end: Get Updates Box -->

                
            </div>
            <!-- end:sidebar -->
        </div>
        <!-- end:row -->
    </div>
    <asp:HiddenField ID="hdfMin" runat="server" Value="1000000" />
    <asp:HiddenField ID="hdfMax" runat="server" Value="5000000" />
     <script>
         var dataSourceJS;
         var Min;
         var max;
         
         (function ($) {
             "use strict";
             //Mega Menu
             $('#menuMega').menu3d();

             //Help/Contact Number/Quick Message
             $('.quickbox').carousel({
                 interval: 10000
             });
             //Filter by Price Slider
             var to = $("#<%=hdfMax.ClientID%>").val();
             var from =  $("#<%=hdfMin.ClientID%>").val();
             $("#price-range").ionRangeSlider({
                 min: 100000,                        // min value
                 max: 200000000,                       // max value
                 from: 10000000,                       // overwrite default FROM setting
                 to: 50000000,                         // overwrite default TO setting
                 type: "double",                 // slider type
                 step: 10000,                       // slider step
                 postfix: "VND",             		// postfix text
                 hasGrid: false,                  // enable grid
                 hideMinMax: false,               // hide Min and Max fields
                 hideFromTo: false,               // hide From and To fields
                 prettify: false,                 // separate large numbers with space, eg. 10 000
                 onChange: function (obj) {        // function-callback, is called on every change
                     $("#<%=hdfMin.ClientID%>").val(obj.fromNumber);
                     $("#<%=hdfMax.ClientID%>").val(obj.toNumber);
                 },
                 onFinish: function (obj) {        // function-callback, is called once, after slider finished it's work
                     console.log(obj);
                 }
             });
         })(jQuery);


         $(function () {
             $("#btnTimKiem").click(function () {
                 __doPostBack('SearchPrice', 'SearchPrice');
             })

             $("#btnXoa").click(function () {
                 __doPostBack('Clear', 'Clear')
             })
         });

         
         function getParameterByName(name) {
             name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
             var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
                 results = regex.exec(location.search);
             return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
         }
 </script>
</asp:Content>
